#include <iostream>
using namespace std;
#define MaxVertex 1005
class Graph{
private:
  int Nv;
  int Ne;
  int AdjMat[MaxVertex][MaxVertex];
  int NowAdjMat[MaxVertex][MaxVertex];
  int visited[MaxVertex];
public:
  Graph(int _Nv,int _Ne);
  int GetComponentNum();//Find the number of connected components
  void DFS(int V);
  int count();
  void check(int p);
};
Graph::Graph(int _Nv,int _Ne){
  Nv=_Nv;
  Ne=_Ne;
  int s;
  int e;
  for(int i=1;i<=Nv;i++){
    visited[i]=0;
    for(int j=1;j<=Nv;j++){
      AdjMat[i][j]=0;
    }
  }
  for(int i=0;i<Ne;i++){
    cin>>s>>e;
    AdjMat[s][e]=1;
    AdjMat[e][s]=1;
  }
}
void Graph::DFS(int V){
  visited[V]=1;
  for(int i=1;i<=Nv-1;i++){
    if(NowAdjMat[V][i]){
      if(visited[i]==0){
        DFS(i);
      }
    }
  }
}
int Graph::count(){
  int num=0;
  for(int i=1;i<=Nv-1;i++){
    if(visited[i]==1){
      num++;
    }
  }
  return num;
}
int Graph::GetComponentNum(){
  int cmpnum=0;
  int ones=0;//How Many ones in the array 'visited'
  for(int i=1;i<Nv;i++){
    DFS(i);
    if(count()>ones){
      cmpnum++;
      ones=count();
    }
  }
  return cmpnum;
}
void Graph::check(int p){
  for(int i=1;i<Nv;i++){
    visited[i]=0;
  }
  for(int i=1;i<=Nv;i++){
    for(int j=1;j<=Nv;j++){
      if(i<p&&j<p){
        NowAdjMat[i][j]=AdjMat[i][j];
      }
      else if(i>p&&j<p){
        NowAdjMat[i-1][j]=AdjMat[i][j];
      }
      else if(i<p&&j>p){
        NowAdjMat[i][j-1]=AdjMat[i][j];
      }
      else if(i>p&&j>p){
        NowAdjMat[i-1][j-1]=AdjMat[i][j];
      }
    }
  }
  int roadnum;
  roadnum=GetComponentNum()-1;
  cout<<roadnum<<endl;
}
int main(){
  int _Nv;
  int _Ne;
  int checkNum;
  cin>>_Nv>>_Ne>>checkNum;
  Graph G(_Nv,_Ne);
  int checksequence[MaxVertex];
  for(int i=0;i<checkNum;i++){
    cin>>checksequence[i];
  }
  for(int i=0;i<checkNum;i++){
    G.check(checksequence[i]);
  }
}
